//
//  Commission.swift
//  OCDistributor
//
//  Created by Sam Chen on 2019/12/11.
//

/// 佣金及交易
public struct OCDistributorCommission: Codable {

    /// 总佣金
    public let total: String

    /// 可用佣金
    public let current: String

    /// 待审核佣金
    public let reviewing: String

    /// 待收益佣金
    public let pending: String

    /// 交易列表
    public let transactions: [Transaction]

    private enum CodingKeys: String, CodingKey {
        case total = "totalProfits"
        case current = "balance"
        case reviewing = "preProfit"
        case pending = "withdrawNotPay"
        case transactions
    }

    /// 交易详情
    public struct Transaction: Codable {
        /// 交易金额
        public let amount: String

        public let description: String
        public let dateAdded: String
    }
}
